package homework.week3.composite.basic;

import homework.week3.composite.IContainer;

/**
 * 基础组件，不再包含其他容器
 */
public class CheckBox implements IContainer {

    /**
     * 框架组合容器组件标题
     */
    private String title;

    /**
     * 组件宽
     */
    private int width;

    /**
     * 组件高
     */
    private int height;

    /**
     * 是否隐藏
     */
    private boolean hidden;

    /**
     * 组件等级，窗体默认0，最大，依次递增
     */
    private Integer level;

    public CheckBox(String title, int width, int height, boolean hidden, Integer level) {
        this.title = title;
        this.width = width;
        this.height = height;
        this.hidden = hidden;
        this.level = level;
    }

    @Override
    public String getContainerName() {
        return this.title;
    }

    @Override
    public int getWidth() {
        return width;
    }

    @Override
    public int getHeight() {
        return height;
    }

    @Override
    public boolean hidden() {
        return hidden;
    }

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    @Override
    public int level() {
        return getLevel();
    }
}
